Subject: RE: Dividing hex numbers by 2
From: Paul Hickman <[email-masked]>
To: "[email-masked]'" <[email-masked]>
Date: Tue, 24 Sep 1996 14:16:47 +0100

>>My AMOS works fine for dividing hex numbers, as you describe, but I only
>>want to divide each digit of the hex number. This is for the screen colours
>>and I want to calculate the half-brite colour. Colour(>31) doesn't work.

You have to use masks:

R=(OldC And $F00)/$100
G=(OldC And $F0)/$10
B=(OldC And $F)
NewC=(R/2)*$100 + (G/2) *$10 + (B/2)